<?php

namespace app\common\validate\Business;

use think\Validate;

/**
 * 客户验证器
 */
class Business extends Validate{

    protected $rule = [
        'mobile' => ['require','regex:/^1[3456789]{1}\d{9}$/','unique:business'],
        'password' => 'require',
        'salt' => 'require',
        'gender' => 'number|in:0,1,2',
        'deal' => 'number|in:0,1',
    ];
    protected $message = [
        'mobile.require' => '用户名未填写',
        'mobile.regex' => '用户名格式有误，尽量不用特殊字符',
        'mobile.unique' => '用户名重复',
        'password.require' => '密码必填',
        'gender.in' => '性别有误',
        'deal.in' => '充值信息有误',
    ];
}